import { createRouter, createWebHistory } from 'vue-router'
import NotFound from '@/views/error/NotFound.vue';
import WeatherView from "@/views/WeatherView.vue"

import DisscussView from "@/views/Disscuss/DisscussView.vue"
import LoginView from "@/views/User/LoginView.vue"
import RegisterView from "@/views/User/RegisterView.vue"
import MapView from '@/views/MapView.vue';
const routes = [
  {
    path: "/",
    name: "index",
    redirect: "/index/",
  },
  {
    path: "/index/",
    name: "index",
    component: WeatherView,
    meta: {
      requestAuth: false,
      requestAuthAdmin: false,
    }
  },
  {
    path: "/map/",
    name: "map",
    component: MapView,
    meta: {
      requestAuth: false,
      requestAuthAdmin: false,
    }
  },
  {
    path: "/disscuss/",
    name: "disscuss",
    component: DisscussView,
    meta: {
      requestAuth: false,
      requestAuthAdmin: false,
    }
  },
  {
    path: "/login/",
    name: "login",
    component: LoginView,
    meta: {
      requestAuth: false,
      requestAuthAdmin: false,
    }
  },
  {
    path: "/register/",
    name: "register",
    component: RegisterView,
    meta: {
      requestAuth: false,
      requestAuthAdmin: false,
    }
  },
  {
    path: "/404/",
    name: "NotFound",
    component: NotFound,
    meta: {
      requestAuth: false,
      requestAuthAdmin: false,
    }
  },
  {
    path: "/:catchAll(.*)",
    redirect: "/index/",
  },
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
